﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApFLEXRotatingAttachment
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

public class CApFLEXRotatingAttachment : CApFLEXAttachment
{
  private readonly TxCableRotatingAttachment m_rotatingAttachment;

  public CApFLEXRotatingAttachment(ICApCableExtentDescriptor cableExtentDescriptor)
    : base(cableExtentDescriptor)
  {
    this.m_rotatingAttachment = new TxCableRotatingAttachment();
  }

  public CApFLEXRotatingAttachment(ITxCable cable, TxCableRotatingAttachment rotatingAttachment)
    : base(cable)
  {
    this.m_rotatingAttachment = rotatingAttachment;
  }

  public override TxCableAttachment Attachment => (TxCableAttachment) this.m_rotatingAttachment;

  public void SetToStart()
  {
    this.m_rotatingAttachment.SetToStart();
    this.NotifyPropertyChanged("Location");
    this.NotifyPropertyChanged("FixedFrame");
    this.NotifyPropertyChanged("LengthFromStart");
  }

  public void SetToEnd()
  {
    this.m_rotatingAttachment.SetToEnd();
    this.NotifyPropertyChanged("Location");
    this.NotifyPropertyChanged("FixedFrame");
    this.NotifyPropertyChanged("LengthFromStart");
  }

  public void SetAlongCable(ITxLocatableObject fixedFrame, double lengthFromStart)
  {
    this.m_rotatingAttachment.SetAlongCable(fixedFrame, lengthFromStart);
    this.NotifyPropertyChanged("Location");
    this.NotifyPropertyChanged("FixedFrame");
    this.NotifyPropertyChanged("LengthFromStart");
  }

  public CApFLEXRotatingAttachmentRotationAxis RotationAxis
  {
    get => (CApFLEXRotatingAttachmentRotationAxis) this.m_rotatingAttachment.RotationAxis;
    set
    {
      this.m_rotatingAttachment.RotationAxis = (TxCableAttachmentRotationAxis) value;
      this.NotifyPropertyChanged(nameof (RotationAxis));
    }
  }
}
